<template>
  <div>
    <template v-if="$app.judgeData(his_list)">
      <div class="overflowH f_14 TJ_big paddingT10">
        <div class="pullLeft f_bold f_16 c333 marginT10 overflowH" style="width:80px;">官文通知</div>
        <div class="TJ_box borderNone">
          <Table :columns="columns" class="marginB10" :data="his_list" stripe border width="1000" @on-sort-change="paiXuGo"></Table>
        </div>
      </div>
    </template>
  </div>
</template>



<script>
export default {
  name: "his_list",
  props: ["orderInfo","orLiInfo", "his_list"],
  data() {
    let that=this;

    let columns = [
      {
        title: "状 态",
        width: 230,
        render: (h, params) => {
          // console.log(params)
          let {
            row: { state_name }
          } = params;

          return h("div", state_name);
        }
      },
      {
        title: "日 期",
        width: 180,
        sortable:true,//启动 本地排序 功能
        sortType:'desc',
        key:'note_date'
      },
      {
        title: "通知书（点击下载）",
        render: (h, params) => {
          let {
            row: { book }
          } = params;
          let out = [];

          book.forEach((val, i) => {
            out.push(
              h(
                "span",
                {
                  on: {
                    click: () => {
                      $app.fileNameAgainDown(val.url,that.orderInfo,that.orLiInfo);
                    }
                  },
                  class: "cBlue  textLine "+((book.length>1)?'marginR30':' ')
                },
                [
                  
                  h("span", val.name)
                ]
              )
            );
          });

          return out;
        }
      }
    ];

    let data = {
      columns
    };
    let tool = {};
    return Object.assign(data, tool);
  },
  mounted() {},
  methods: {
    paiXuGo(obj){
      console.log('排序 = ',obj.order);
    }
  }
};
</script>